// Texture OpenGL
// (c) jimon game studio

#ifndef JEH_CTEXTURE_OPENGL
#define JEH_CTEXTURE_OPENGL

#include "ITexture.h"
#include "CRender_OpenGL_Extensions.h"
#include "jeOpenGLSystemHeader.h"

#ifdef JE_RENDER_OPENGL

#include "jeOpenGLWorkMode.h"

namespace je
{
	namespace video
	{
		//! Texture OpenGL
		class CTexture_OpenGL:public je::video::ITexture
		{
		private:
			//! Extensions
			CRender_OpenGL_Extensions * Extensions;

			//! OpenGL Texture ID
			GLuint TextureID;

			//! OpenGL Texture Type
			GLenum TextureType;

			//! Original Size
			jeVector2di OriginalSize;
			
			//! OpenGL Work Mode
			OpenGLWorkMode CurrentWorkMode;

			//! Render Buffer Mode
			u1 RenderBufferMode;

			//! Samples
			s32 CurrentSamples;
		public:
			//! Constructor
			CTexture_OpenGL(u8 Type,CRender_OpenGL_Extensions * extensions,const jeVector2di & Size,IImage * Image,TextureFormat Format,s32 Flags,s32 Samples,OpenGLWorkMode WorkMode);

			//! Destructor
			~CTexture_OpenGL();

			//! Get Size
			const jeVector2di & GetSize();

			//! Copy To
			void CopyTo(ITexture * Texture);

			//! Copy To
			void CopyTo(IImage * Image);

			//! Copy From
			void CopyFrom(IImage * Image);

			//! Return texture opengl id
			GLuint GetTextureOpenGLID()
			{
				return TextureID;
			}

			//! Return texture opengl type
			GLenum GetTextureOpenGLType()
			{
				return TextureType;
			}

			//! Is Render Buffer
			u1 IsRenderBuffer()
			{
				return RenderBufferMode;
			}
		};
	}
}

#endif
#endif
